package maosy.oauth2.server.test.spring.repository

import maosy.oauth2.server.inline.password
import maosy.oauth2.server.jpa.bean.OauthClientDetailsEntity
import maosy.oauth2.server.jpa.repository.ClientRepository
import maosy.oauth2.server.test.spring.SpringTest
import org.junit.Test
import org.springframework.beans.factory.annotation.Autowired

class ClientRepositoryTest : SpringTest() {

    @Autowired
    lateinit var clientRepository: ClientRepository

    @Test
    fun saveClient() {
        val result = clientRepository.save(OauthClientDetailsEntity().apply {
            this.clientId = "admin_server"
            this.clientSecret = String.password("123456")
            this.scope = "all"
            this.resourceIds = "*"
        })
        println(result)
    }

}